package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.SysRoleService;
import com.atguigu.spzx.manager.service.SysRoleUserService;
import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: SysRoleUserController
 * Package: com.atguigu.spzx.manager.controller
 * Description:
 *
 * @Author 刘强
 * @Create 2024/7/2 20:29
 * @Version 1.0
 */
@RestController
@RequestMapping("/admin/system/sysRoleUser")
public class SysRoleUserController {
    @Resource
    private SysRoleUserService sysRoleUserService ;

    /**
     *  添加用户角色关系
     * @param assginRoleDto
     * @return
     */
    @PostMapping("doAssign")
    public Result doAssign(@RequestBody AssginRoleDto assginRoleDto){
        sysRoleUserService.doAssign(assginRoleDto);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
